package net.jarang.android.saleoffline.activity;

import net.jarang.android.saleoffline.activity.sale.SaleListActivity;
import net.jarang.android.saleoffline.activity.sale.SaleRegisterActivity;
import net.jarang.android.saleoffline.activity.sale.SaleSettingActivity;
import net.jarang.android.saleoffline.domain.appinfo.AppManager;
import android.app.TabActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Window;
import android.widget.TabHost;

public class MainActivity extends TabActivity {
	
	@Override
    public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
        
		new AppManager(this).init();
		
        TabHost tabHost = getTabHost();
        tabHost.addTab(tabHost.newTabSpec("tab1")
        		.setIndicator("홈", getResources().getDrawable(R.drawable.chat))
        		.setContent(new Intent(this, HomeActivity.class)));

        tabHost.addTab(tabHost.newTabSpec("tab2")
        		.setIndicator("세일목록", getResources().getDrawable(R.drawable.beermug))
        		.setContent(new Intent(this, SaleListActivity.class)));
        
        tabHost.addTab(tabHost.newTabSpec("tab3")
        		.setIndicator("상품등록", getResources().getDrawable(R.drawable.key))
        		.setContent(new Intent(this, SaleRegisterActivity.class)));
        
        tabHost.addTab(tabHost.newTabSpec("tab4")
        		.setIndicator("설정", getResources().getDrawable(R.drawable.skull))
        		.setContent(new Intent(this, SaleSettingActivity.class)));
        
//        tabHost.getTabWidget().getChildAt(0).setBackgroundColor(Color.parseColor("#534512")); 
        tabHost.setCurrentTab(0);
    }
}